home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / systems / atari / birkhahn-metafont-packed-disks / mf27-2_2e-disk2.zoo / inputs / pandora.lzs / PANACC.MF < prev    next >
Text File  |  1991-06-14  |  26KB  |  633 lines

  1. %*****************************************************************************
  2. %        Copyright (c) 1989 by N. N. Billawala
  3. %*****************************************************************************
  4.  
  5.  
  6. % accent.mf  miscellaneous accents, ligatures and chars for foreign languages
  7.  
  8. %19 characters; iff OK "x": for testing
  9.  
  10.  
  11.  
  12. iff OK "x":  "The letter i with no dot"; 
  13.   beginchar(oct"020",i_w*width#+a_mono#,xheight#,0); 
  14.  
  15.   bot z40=(if singlepitch:.65w else:.5w fi,0);  multpos(1,4,40)(stem.lc,0);      
  16.   lft x4l=round x40l; bot y4=0;  
  17.   z1=(x4,h)//; 
  18.   onaline(1l,4l)(2l,3l);   y3l=y3r=x_bracket_h;           
  19.   onaline(1r,4r)(2r,3r);   y2l=y2r=max(h-x_bracket_h,y3l);
  20.  
  21.   p1=fullserif(z4,z1,z3l,z3r,.75hs,.75hs)--
  22.      terminalserif.l(z1,z4,z2l,z2r,.5ts,x_terminal_angle)--cycle;
  23.   if singlepitch:pickup pencircle yscaled thin_stem.lc rotated -oblique;
  24.     lft top z12=(0,h)//; rt top z13=(x1,h); 
  25.     draw z12--z13; showpoints(12,13);
  26.     fi  
  27.  
  28.   showpoints(1,2,3,4,40);
  29. adjust(v_a*fitbasis.lc#+m_a*a_mfit#,v_a*fitbasis.lc#+m_a*a_mfit#); 
  30. show_character; endchar;
  31.  
  32. % Exactly the came character as the lowercase "i", but with no dot
  33.  
  34.  
  35.  
  36. iff OK "x":  "The letter j with no dot";
  37.   beginchar(oct"021",j_w*width#+a_mono#,xheight#,descender#);
  38.  
  39.   top rt z1r=(w,h)//;        multpos(1,4)(stem.lc,0);
  40.   rt z4r=(w,0);      
  41.   onaline(1l,4l)(2l,3l);     y3l=max(.25xheight,-d+(l_arch*(d+.25xheight)));
  42.   onaline(1r,4r)(2r,3r);     y3r=max(.25xheight,-d+(r_arch*(d+.25xheight)));
  43.   onaline(1,4)(11);          y11=y1+max(1,.2h);  y2l=y2r=h-x_bracket_h;
  44.   lft z6=(0,-.95d)//;      
  45.   save_num(knob)=min(bulb_thickness,.3*abs(x4l-x6));            
  46.   bot y5r=top y5l-minor_curve.lc=-d-ov_b.lc;
  47.   good_x_for(5r)(z6,z3r,.4)a;  good_x_for(5l)(z6+(knob,0),z3l,.4)b;
  48.  
  49.   p1=terminalserif.l(z1,z4,z2l,z2r,.5ts,x_terminal_angle)--z3l{downward} i_t
  50.      bulb.bl(z6,z5l,z5r,.5cs,knob,90) o_t z3r{upward}--cycle;
  51.  
  52.  if singlepitch:pickup pencircle yscaled thin_stem.lc rotated -oblique;
  53.     lft top z12=(.2w,h)//; rt top z13=(x1,h); 
  54.     draw z12--z13; showpoints(12,13);
  55.     fi  
  56.  
  57.   showpoints(1,2,3,4,5,6,11);
  58. adjust(m_ee*a_mfit#,v_a*fitbasis.lc#+m_e*a_mfit#);
  59. show_character; endchar;
  60.  
  61. % Exactly the came character as the lowercase "j", but with no dot
  62.  
  63.  
  64.  
  65. iff OK "x":  "Grave accent";     %******* .8 ACCENT WIDTH  x  1 ACCENT DEPTH
  66.   beginchar(oct"022",.8accent_w*width#+b_mono#,
  67.     accent_height#+xheight#+accent_depth#,0); 
  68.   top rt z1=(0,h)//;  
  69.   bot lft z2=(w,h-max(1,accent_depth))//;
  70.   p1=prime_accent(z1,z2,accent_thick_end,accent_thin_end);
  71.   showpoints(1,2);
  72.  
  73. draw (0,xheight)--(w,xheight);
  74. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  75. show_character; endchar;
  76.  
  77.     
  78.  
  79. iff OK "x":  "Acute accent";     %******* .8 ACCENT WIDTH  x  1 ACCENT DEPTH
  80.   beginchar(oct"023",.8accent_w*width#+b_mono#,
  81.     accent_height#+xheight#+accent_depth#,0); 
  82.   top rt z1=(w,h)//;  
  83.   bot lft z2=(0,h-max(1,accent_depth))//;
  84.   p1=prime_accent(z1,z2,accent_thick_end,accent_thin_end);
  85.   showpoints(1,2);
  86.  
  87. draw (0,xheight)--(w,xheight);
  88. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  89. show_character; endchar;
  90.  
  91.  
  92.  
  93. iff OK "x":  "Hachek accent";   %******* 1 ACCENT WIDTH  x  2/3 ACCENT DEPTH
  94.   beginchar(oct"024",accent_w*width#+b_mono#,
  95.     accent_height#+xheight#+2/3accent_depth#,0); 
  96.   save theta,adjustment;
  97.   top lft z1=(0,h)//;  
  98.   bot z2l=bot z22=(.5w,h-max(1,2/3accent_depth))//;
  99.   rt z3=(w,y1)//;   
  100.   pos2(.6[accent_thin_end,accent_thick_end],90);
  101.   pos22(min(apex.lc,.5stem.lc),0-apex_angle);
  102.   if y2=y1: x1:=x1+eps; fi      % keeps from division by 0 error on next line
  103.   if bold:theta1=theta3=0; adjustment=1/cosd (angle(z2-z1)+90); 
  104.     else:theta1=angle(z1-z2)-90;theta3=angle(z3-z2)-90;adjustment=1; fi
  105.   pos1(accent_thin_end*adjustment,theta1);
  106.   pos3(accent_thin_end*adjustment,theta3);
  107.   onaline(1,2)(23); onaline(1l,22l)(21);
  108.   onaline(2,3)(21); onaline(22r,3r)(23); 
  109.  
  110.   p1=if realsoft_accents: (z2r soften(z1r,z1l) z21{z21-z1l}...
  111.         z23{z3r-z23} soften(z3r,z3l) z2r)--cycle;
  112.        else: (z2r soften(z1r,z1l,z22l,z22r,z3r,z3l) z2r)--cycle; fi
  113.  
  114.   showpoints(1,2,3,21,22,23);
  115.  
  116. draw (0,xheight)--(w,xheight);
  117. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  118. show_character; endchar;
  119.  
  120. % Currently the angle of the accent is based on a varying "accent_depth"
  121. % The thetas are the angles at the ends, flattened for bold chars,
  122. % but theta could be an arbitrary value
  123.  
  124.  
  125.  
  126. iff OK "x":  "Breve accent";   %******* 1 ACCENT WIDTH  x  2/3 ACCENT DEPTH
  127.   beginchar(oct"025",accent_w*width#+b_mono#,
  128.     accent_height#+xheight#+accent_depth#,0); 
  129.   save theta,adjustment;
  130.   save_num(thickness)=.5[accent_thin_end,accent_thick_end];
  131.   top lft z1l=(0,h)//; 
  132.   bot z2l=(.5w,h-accent_depth)//;
  133.   rt z3r=(w,y1l)//;
  134.   pos2(thickness,90);  
  135.   if y2l=y1l: x1l:=x1l+eps; fi    % keeps from division by 0 error on next line
  136.   ref1=z1l...z2l{right}; ref2=z3r...z2l{right};
  137.   if bold:theta1=theta3=0; adjustment=1/cosd (angle(direction 0 of ref1)+90); 
  138.     else:adjustment=1;
  139.          theta1=angle(direction 0 of ref1)+90;
  140.          theta3=angle(direction 0 of ref2)-90;fi
  141.   pos1(thickness*adjustment,theta1);
  142.   pos3(thickness*adjustment,theta3);
  143.   save_pair(end_dir)=if abs(y1l-y2l)>abs(x1l-x2l):upward else:(0,0) fi;
  144.  
  145.   p1=(z2l{right}...z3r{end_dir}
  146.         if softpath:)softjoin(z3r--z3l)softjoin( else:-- fi 
  147.       z3l{-end_dir}...z2r{left}...z1r{end_dir}
  148.         if softpath:)softjoin(z1r--z1l)softjoin( else:-- fi
  149.       z1l...z2l{right})--cycle;
  150.  
  151.   showpoints(1,2,3);
  152.  
  153. draw (0,xheight)--(w,xheight);
  154. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  155. show_character; endchar;
  156.  
  157. % Currently the angle of the accent is based on a varying "accent_depth"
  158. % The thetas are the angles at the ends, flattened for bold chars,
  159. % but theta could be an arbitrary value
  160.  
  161.  
  162.  
  163. iff OK "x":  "Macron accent";   %******* 1 ACCENT WIDTH  x  .5 ACCENT DEPTH
  164.   beginchar(oct"026",accent_w*width#+b_mono#,
  165.     accent_height#+xheight#+accent_depth#,0); 
  166.   min_limit(join_radius)(.25[accent_thin_end,accent_thick_end]);
  167.   lft z1=(0,h-.5accent_depth)//;  
  168.   rt z3=(w,y1)//;
  169.   multpos(1,3)(.5[accent_thin_end,accent_thick_end],90);
  170.   z2l=.5[z1l,z3l];
  171.  
  172.   p1=(z2l soften(z3l,z3r,z1r,z1l) z2l)--cycle;
  173.  
  174.   showpoints(1,2,3);
  175.  
  176. draw (0,xheight)--(w,xheight);
  177. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  178. show_character; endchar;
  179.  
  180.  
  181.  
  182. iff OK "x":  "Circle accent";   %******* 1 ACCENT WIDTH  x  ACCENT DEPTH
  183.   beginchar(oct"027",accent_w*width#+b_mono#,
  184.     accent_height#+xheight#+accent_depth#,0); 
  185.  
  186.   save thickness; 
  187.   thickness=min(.3[accent_thin_end,accent_thick_end],.3*accent_depth-1);
  188.   z0=(.5w,h-.5*max(2,accent_depth))//;
  189.   top z1r=(x0,h);                               pos1(thickness,90);
  190.   bot z3r=(x0,round(h-max(2,accent_depth)));    pos3(thickness,-90);
  191.   lft z2r=(round(x0-.5(y1r-y3r)),.5[y1r,y3r]);  pos2(thickness,180);
  192.   rt z4r=(round(x0+.5(y1r-y3r)),y2r);           pos4(thickness,0);
  193.  
  194.   p1 =z1r{left} o_t z2r{downward} o_t z3r{right} o_t z4r{upward} o_t cycle;
  195.   p1'=z1l{left} i_t z2l{downward} i_t z3l{right} i_t z4l{upward} i_t cycle;
  196.   
  197.   showpoints(1,2,3,4);
  198.  
  199. draw (0,xheight)--(w,xheight);
  200. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  201. show_character; endchar;
  202.  
  203.  
  204.  
  205. iff OK "x":  "Cedilla";   %******* 1 ACCENT WIDTH  x  .75  ACCENT DEPTH
  206.   beginchar(oct"030",accent_w*width#+b_mono#,0,descender#); 
  207.  
  208.   bot lft z1l=(.35w,-min(.75accent_depth,d))//;
  209.   multpos(1,3)(max(.15accent_depth,accent_thin_end),90-oblique);
  210.   lft z4r=(.5w,0)//;                 pos4(.25accent_depth,80-oblique); 
  211.   rt z5r=lft z4r+(.5[accent_thin_end,accent_thick_end],0);
  212.   z3l=z4l;                           pos5(accent_depth,80-oblique); 
  213.   rt z2r=(w,.5[y1l,y3r])//;          pos2(accent_thick_end,0);
  214.   ref1=z2r{upward}...z3{left};
  215.   z20=ref1 intersectionpoint (z5r--z5l);
  216.   (t1,t2)=ref1 intersectiontimes (z5r--z5l);
  217.  
  218.   p1=(subpath(0,t1)of ref1--z5r--z4r--z4l   if softpath:)softjoin(z4l fi 
  219.       --z3l{right}...z2l{downward}...z1r{left}
  220.         if softpath:)softjoin(z1r--z1l)softjoin( else:-- fi 
  221.       z1l{right}...z2r{upward})--cycle;
  222.  
  223.   showpoints(1,2,3,4,5);
  224.  
  225. draw (0,xheight)--(w,xheight);
  226. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  227. show_character; endchar;
  228.  
  229.  
  230.  
  231. iff OK "x":  "The Double S Ligature or scharfes S";  
  232.   beginchar(oct"031",b_w*width#+d_mono#,ascender#,0); 
  233.  
  234.   min_limit(join_radius)(.5*max(1,thin_stem.lc)); 
  235.   lft z1l=(0,xheight)//;  multpos(1,4)(stem.lc,0);
  236.   bot lft z4l=(0,0);      y3l=y3r=x_bracket_h;
  237.   onaline(1l,4l)(2l,3l);  y2l=max(xheight,.75xheight+(r_arch*(h-xheight)));
  238.   onaline(1r,4r)(2r,3r);  y2r=max(xheight,.75xheight+(l_arch*(h-xheight)));
  239.  
  240.   top z10r=(.45w,h+ov_t.lc)//;    pos10(minor_curve.lc,90);
  241.   z13l=(.3[x3r,w],.55h)//;        multpos(11,12,13)(1[thin_stem.lc,stem.lc],0);
  242.   bot y16r=top y16l-minor_curve.lc=-ov_b.lc;  
  243.   z17l=(.2[x3r,w],y16l)//;        pos17(thin_stem.lc,-90); 
  244.   y17r:=max(0,y17r);   
  245.   rt z15r=(w,.4[y16r,y13r])//;   multpos(14,15)(bowlstem.lc,0);
  246.   good_x_for(16l)(z17l,z15l,.4)a; good_x_for(16r)(z17r,z15r,.5)b; 
  247.   good_x_for(11l)(z13l,z15l,.5)c; y11l=.5[y13r,y10r]; 
  248.   z12=.5[z11,z13]; 
  249.   z14=.5[z13,z15]; 
  250.  
  251.   p1=(terminalserif.l(z4,z1,z3l,z3r,.5hs,0)soft--z2r{upward} i_t
  252.      z10l{right} i_t z11l{downward}...z12l... z13l{downward}...z14l...
  253.      z15l{downward} i_t z16l{left} i_t z17l
  254.        if softpath:)softjoin(z17l--z17r)softjoin( else:-- fi
  255.      z17r o_t z16r{right} o_t z15r{upward}...z14r...z13r{upward}...z12r...
  256.      z11r{upward} o_t z10r{left} o_t z2l{downward})--cycle;
  257.   p2=terminalserif.l(.5[z1l,z1],.5[z4l,z4],z3l,.5[z3l,z3r],.75hs,
  258.      x_terminal_angle)--cycle;
  259.  
  260.   min_limit(join_radius)(.5*max(1,.75minor_curve.lc)); 
  261.   showpoints(1,2,3,4,10,11,12,13,14,15,16,17);
  262. adjust(v_a*fitbasis.lc#+m_b*d_mfit#,v_g*fitbasis.lc#+m_bb*d_mfit#); 
  263. show_character; endchar;
  264.  
  265.  
  266.  
  267. iff OK "x":  "The ae ligature";   
  268.   beginchar(oct"032",ae_w*width#+f_mono#,xheight#,0);
  269.  
  270.   min_limit(join_radius)(.5*max(1,.75minor_curve.lc));                % "e" part
  271.   bot rt z1r=
  272.    (if narrow_condition:w else:.95w fi,round(.6h-.65*.8thin_stem.lc))//;
  273.   pos1(max(1,.85stem.lc),ebar_angle);
  274.   rt z3r=(round(if mono=0:a_w*width else:.5f_mono+.45stem.lc fi),.5h)//;
  275.   pos3(if narrow_condition:narrow_amt[thin_stem.lc,stem.lc] 
  276.         else:max(1,.9stem.lc) fi,0);
  277.   rt z5l=(w,.15h)//;             pos5(max(1,.75minor_curve.lc),130-oblique); 
  278.   top y2l=bot y2r+major_curve.lc=h+ov_t.lc;    
  279.   bot y4l=top y4r-minor_curve.lc=-ov_t.lc;   
  280.   good_x_for(2l)(z3l,z1r,.6)a;   good_x_for(2r)(z3r,z1l,.6)b; 
  281.   good_x_for(4l)(z3l,z5l,.5)c;   good_x_for(4r)(z3r,z5r,.5)d;
  282.   x4r:=min(x4r,x4l+minor_curve.lc); 
  283.   onaline(1l,1r)(40); x40=x41=0;
  284.   z42=z1r+(max(1,.8thin_stem.lc),0)rotated(90+ebar_angle);  
  285.   z42-z41=whatever*(z1r-z1l);
  286.  
  287.   lft z109=(if narrow_condition:0 else:.05w fi,.9h)//;                % "a" part
  288.   rt z114r=(round(if mono=0:a_w*width else:.5f_mono+.45stem.lc fi),0);
  289.   lft z114l=(rt x114r-max(1,.9stem.lc),0);
  290.   z111r=(x114r,max(r_arch*h,y3r))//;       pos111(max(1,.9stem.lc),0); 
  291.   top y110r=bot y110l+arch_thickness.lc=h+ov_t.lc;    
  292.   good_x_for(110r)(z109,z114r,min(.95,arch_reference+.1))e; 
  293.   good_x_for(110l)(z109,z114l,arch_inner_amt)f;
  294.   x110l:=max(x110l,x110r-arch_thickness.lc);
  295.   onaline(111l,114l)(101l,101r);
  296.   y101r=y101l+max(1,minor_curve.lc)=.55h+.75minor_curve.lc;
  297.   lft z103l=(0,.35[-ov_b.lc,y101r])//; 
  298.   rt z103r=(lft x103l+if narrow_condition:narrow_amt[thin_stem.lc,stem.lc] 
  299.            else:max(1,bowlstem.lc) fi,max(.4[-ov_b.lc,y101r],major_curve.lc));  
  300.   y102=.75y101r;  good_x_for(102)(z103l,z101r,.4)g;
  301.                                                                       % "e" part
  302.   ref1=z2r{right}..tension atleast .8 .. z1l{downward};  % inner right ref path
  303.   ref2=z5r i_t z4r{left} i_t z3r{upward} i_t z2r{right}; % inner left ref path
  304.   ref3=z1r--z40;                                         % outer bar ref path
  305.   ref4=z41--z42;                                         % inner bar ref path
  306.   ref5=z2l{left} o_t_c z3l{downward} o_t_c z4l{right}; 
  307.   ref6=z4l{left} o_t_c z3l{upward}; 
  308.   (t1,t2)=ref2 intersectiontimes ref3;  z20=ref2 intersectionpoint ref3;
  309.   (t3,t4)=ref2 intersectiontimes ref4;  z21=ref2 intersectionpoint ref4;  
  310.   (t5,t6)=ref1 intersectiontimes ref4;  z22=ref1 intersectionpoint ref4;  
  311.  
  312.   ref101=z3r{upward}...z111r{upward} o_t_c 
  313.          bulb.tl(z109,z110l,z110r,.75cs,.5bulb_thickness,90);
  314.   z105=(xpart point.5of ref6,ypart point.5of ref6+minor_bowl_tip.lc);
  315.   ref102=arch.bl(z105,-ov_b.lc,z103r,z103l)lc; 
  316.   ref103=(0,y101l)--(w,y101l)//;
  317.   (t7,t8)  =ref5 intersectiontimes ref101;
  318.   (t9,t10) =ref5 intersectiontimes ref103;
  319.   (t11,t12)=ref5 intersectiontimes reverse ref102;
  320.   (t13,t14)=ref6 intersectiontimes ref102;
  321.  
  322.   p1=(subpath(t8,infinity)of ref101 i_t z111l--
  323.        z101r{z102-z101r}...z103l{downward}--
  324.       subpath(0,t14)of ref102-- subpath(t13,0)of ref6 o_t_c z5l 
  325.         if softpath:)softjoin(z5l--z5r)softjoin( else:-- fi
  326.       subpath(0,t1)of ref2--z20 if softpath:)softjoin(z20 fi
  327.       --z1r)softjoin(z1r{upward}..tension atleast .8 .. z2l{left}--
  328.       subpath(0,t7)of ref5)--cycle;
  329.   p1'=subpath(0,t5)of ref1--z22-(eps,0)--z21+(eps,0)--              % eye of "e"
  330.       subpath(t3,infinity)of ref2--cycle;
  331.   p2'=subpath(0,t12)of reverse ref102--                             % eye of "a"
  332.       subpath(t11-eps,t9+eps)of ref5{z102-z101r}...cycle;
  333.  
  334.   showpoints(1,2,3,4,5,20,21,22,40,41,42,101,102,103,105,106,109,110,111,114);
  335. adjust(v_f*fitbasis.lc#+m_a*f_mfit#,v_f*fitbasis.lc#+m_a*f_mfit#); 
  336. show_character; endchar;
  337.  
  338. % There's still an intersection problem with this, but it seems to work for now
  339. % Based on the lowercase "a" and "e"
  340.  
  341.  
  342.  
  343. iff OK "x":  "The oe ligature"; 
  344.   beginchar(oct"033",oe_w*width#+f_mono#,xheight#,0);
  345.   min_limit(join_radius)(.5*max(1,.75minor_curve.lc)); 
  346.                       
  347.   top y11r=h+ov_t.lc;          bot y11l=top y11r-minor_curve.lc;      % "o" part
  348.   bot y13r=-ov_b.lc;           top y13l=bot y13r+minor_curve.lc;  
  349.   lft z12r=(0,(1-v_stress)*h)//; 
  350.   rt z12l=(lft x12r+bowlstem.lc,(1-v_stress)*h);
  351.   rt z14r=(if mono=0:oo_w*width else:.52f_mono+.45bowlstem.lc fi,.5h)//; 
  352.   lft z14l=(round(x14r-if narrow_condition:narrow_amt[thin_stem.lc,bowlstem.lc] 
  353.                         else:max(1,.9bowlstem.lc) fi),.5h);  
  354.   good_x_for(11r)(z12r,z14r,.53)a;  good_x_for(11l)(z12l,z14l,.47)b;  
  355.   good_x_for(13r)(z12r,z14r,.47)c;  good_x_for(13l)(z12l,z14l,.53)d;  
  356.  
  357.   p1 =z11r{left} o_t_c z12r{downward} o_t_c z13r{right} o_t_c 
  358.       z14r{upward} o_t_c cycle;
  359.   p1'=z11l{left} i_t z12l{downward} i_t z13l{right} i_t z14l{upward} i_t cycle;
  360.  
  361.   bot rt z1r=                                                         % "e" part
  362.    (if narrow_condition:w else:.95w fi,round(.6h-.65*.8thin_stem.lc))//;
  363.   z3l=z14l; z3r=z14r;            
  364.   pos1(if narrow_condition:w_narrow_amt[thin_stem.lc,stem.lc] 
  365.         else:max(1,.85stem.lc) fi,ebar_angle);
  366.   rt z5l=(w,.15h)//;             pos5(max(1,.75minor_curve.lc),130-oblique); 
  367.   top y2l=bot y2r+major_curve.lc=h+ov_t.lc;    
  368.   bot y4l=top y4r-minor_curve.lc=-ov_t.lc;   
  369.   good_x_for(2l)(z3l,z1r,.6)e;   good_x_for(2r)(z3r,z1l,.6)f; 
  370.   good_x_for(4l)(z3l,z5l,.5)g;   good_x_for(4r)(z3r,z5r,.5)h;
  371.   x4r:=min(x4r,x4l+minor_curve.lc); 
  372.   onaline(1l,1r)(40); x40=x41=0;
  373.   z42=z1r+(max(1,.8thin_stem.lc),0)rotated(90+ebar_angle);  
  374.   z42-z41=whatever*(z1r-z1l);
  375.  
  376.   ref1=z2r{right}..tension atleast .8 ..z1l{downward};   % inner right ref path
  377.   ref2=z5r i_t z4r{left} i_t z3r{upward} i_t z2r{right}; % inner left ref path
  378.   ref3=z1r--z40;                                         % outer bar ref path
  379.   ref4=z41--z42;                                         % inner bar ref path
  380.   z20=ref2 intersectionpoint ref3;  (t1,t2)=ref2 intersectiontimes ref3;
  381.   z21=ref2 intersectionpoint ref4;  (t3,t4)=ref2 intersectiontimes ref4;
  382.   z22=ref1 intersectionpoint ref4;  (t5,t6)=ref1 intersectiontimes ref4;
  383.  
  384.   p2 =(z2l{left} o_t_c z3l{downward} o_t_c z4l{right} o_t_c z5l
  385.         if softpath:)softjoin(z5l--z5r)softjoin( else:-- fi
  386.       subpath(0,t1)of ref2--z20 if softpath:)softjoin(z20 fi
  387.       --z1r)softjoin(z1r{upward}..tension atleast .8 ..z2l{left})--cycle;
  388.   p2'=subpath(0,t5)of ref1--z22-(eps,0)--z21+(eps,0)--              % eye of "e"
  389.       subpath(t3,infinity)of ref2--cycle;
  390.  
  391.   showpoints(1,2,3,4,5,11,12,13,14,20,21,22,40,41,42);
  392. adjust(v_c*fitbasis.lc#+m_a*f_mfit#,v_f*fitbasis.lc#+m_a*f_mfit#); 
  393. show_character; endchar;
  394.  
  395. % This character is based on the "o" and the "e". The center curved stem
  396. % has been decreased a bit and the center reference points are made to 
  397. % coincide and keep a constant height of .5h. The rightmost point of the
  398. % "e" has been extended to w from .95w
  399.  
  400.  
  401.  
  402.  
  403. iff OK "x":  "The lowercase o with slash"; 
  404.   beginchar(oct"034",oo_w*width#+d_mono#,xheight#,0);
  405.                       
  406.   top z1=(h_stress*w,h+ov_t.uc)//;                                   % circle 
  407.   lft z2=(0,(1-v_stress)*h)//;
  408.   bot z3=((1-h_stress)*w,-ov_b.uc)//;  
  409.   rt z4=(w,v_stress*h)//;      
  410.  
  411.   circular_shape(y1,y3,x2,x4,minor_curve.lc,bowlstem.lc);            % circle
  412.  
  413.   pickup  slashpen rotated angle((.95w,h)//-(.05w,0)//);             % slash
  414.   top rt z11=(.95w,1.1h)//;          
  415.   bot lft z12=(.05w,-.1h)//;
  416.   draw z11--z12;
  417.  
  418.  showpoints(1,2,3,4,11,12);
  419. adjust(v_c*fitbasis.lc#+m_a*d_mfit#,v_c*fitbasis.lc#+m_a*d_mfit#); 
  420. show_character; endchar;
  421.  
  422. % This is just a lowercase "o" with a slash added
  423. % Only y1/y3 and x2/x4 values actually used; the points are put in for proofs
  424.  
  425.  
  426.  
  427. iff OK "x":  "The AE ligature"; 
  428.   beginchar(oct"035",AE_w*width#+f_mono#,cap#,0);
  429.  
  430.   save_bool(nonotch):=if(cap<40):true else:false fi;          % if real low res
  431.   bot lft z14l=(2/3*A_w*width+.5f_mono,0);                          % E part
  432.   top z11l=(x14l,h)//;             
  433.   multpos(11,14)(if narrow_condition:narrow_amt 
  434.                   else:1 fi[thin_stem.uc,stem.uc],0); 
  435.   onaline(11l,14l)(13l,40,42,43);  y13l=cap_bracket_h; 
  436.   onaline(11r,14r)(1,4,4l,4r,6);   y40=y2r-max(thin_stem.uc,.3stem.uc,1);
  437.   top y2r=h; 
  438.   bot y1=bot y2l=top y2r-max(1,.95thin_stem.uc);
  439.   top rt z3=(if narrow_condition:w else:.95w fi,h)//;
  440.   bot y7l=0; 
  441.   bot rt z8=(w,0);
  442.   top y6=top y7r=bot y7l+max(1,.97thin_stem.uc);
  443.   y4=.55h; 
  444.   top y4r=bot y4l+max(1,.9thin_stem.uc)=top y5r=round(y4+.45thin_stem.uc);
  445.   good_x_for(2r)(z1,z3,.6)a;  good_x_for(2l)(z1,z3,.6)b;
  446.   good_x_for(7r)(z6,z8,.6)c;  good_x_for(7l)(z6,z8,.6)d;                
  447.   good_x_for(5r)(z4,z3,.8)e;
  448.  
  449.   z21r=z40;                                                        % A part
  450.   bot lft z23l=(0,0); 
  451.   multpos(21,23)(thin_stem.uc,constant_angle(z21r,z23l,thin_stem.uc));
  452.   onaline(21l,23l)(22l);       y41=y42=round(.33y21); y22l=cap_bracket_h; 
  453.   onaline(21r,23r)(22r,41,44); y43=y44=y41+max(1,.7thin_stem.uc);% bar height
  454.   onaline(21,23)(20,24);       top y20=h; y22r=min(y41,y22l); bot y24=0; 
  455.   ref1=z43--z40--z44; 
  456.  
  457.   p1=(arm.br(z8,z7r,z7l,.5as,.75tip_thickness,90-arm_angle)soft soften(z6,z4l)
  458.       arm.tr(z5r,z4l,z4r,.15as,.25tip_thickness,90) soften(z4r,z1)
  459.       arm.tr(z3,z2l,z2r,.4as,.75tip_thickness,90)soft...
  460.       leftserif(z20,z23,z22l,z23r,.1hs)--
  461.       fullserif.l(z24,z21,z22l,z22r,.5hs,.5hs) soften(z41,z42)
  462.       leftserif(z14,z11,z13l,z11r,.1hs))..cycle;
  463.   p1'=upnotch(ref1,angle(z40-z43),notch_length.uc)etchright--cycle;
  464.  
  465.   showpoints(1,2,3,4,5,6,7,11,12,13,14,20,21,22,23,24,40,41,42,43,44);  
  466. adjust(v_I*fitbasis.uc#+m_a*f_mfit#,v_F*fitbasis.uc#+m_a*f_mfit#); 
  467. show_character; endchar;
  468.  
  469. % Based on the E and the left stem of the A; shortened serif on E
  470.  
  471.  
  472.  
  473. iff OK "x":  "The OE ligature"; 
  474.   beginchar(oct"036",OE_w*width#+f_mono#,cap#,0);
  475.  
  476.   if singlepitch:save circ; circ1=circ2=circ3=.75; fi   
  477.   rt z14r=(round(if mono=0:O_w*width else:.55f_mono+.5stem.lc fi),0)//; 
  478.   top z11l=(x14l,h)//;                                               % E part 
  479.   multpos(11,14)(if narrow_condition:.9%********narrow_amt 
  480.                   else:1 fi[thin_stem.uc,stem.uc],0);  
  481.   onaline(11l,14l)(12l,13l,24l,25l);     y13l=cap_bracket_h; 
  482.   onaline(11r,14r)(1,4,4l,4r,6,24r,25r); y12l=max(h-cap_bracket_h,y13l);
  483.   top y2r=h;                             y24l=y24r=.35h; y25l=y25r=h-y24l;
  484.   bot y1=bot y2l=top y2r-max(1,.95thin_stem.uc);
  485.   top rt z3=(if narrow_condition:w else:.95w fi,h)//;
  486.   bot y7l=0; 
  487.   bot rt z8=(w,0);
  488.   top y6=top y7r=bot y7l+max(1,.97thin_stem.uc); 
  489.   y4=.55h; 
  490.   top y4r=bot y4l+max(1,.9thin_stem.uc)=top y5r=round(y4+.45thin_stem.uc);
  491.   good_x_for(2r)(z1,z3,.6)a;  good_x_for(2l)(z1,z3,.6)b;
  492.   good_x_for(7r)(z6,z8,.6)c;  good_x_for(7l)(z6,z8,.6)d;                
  493.   good_x_for(5r)(z4,z3,.8)e; 
  494.  
  495.   top y21r=bot y21l+minor_curve.uc=h;                                % O part
  496.   bot y23r=top y23l-minor_curve.uc=0;  
  497.   lft z22r=(0,(1-v_stress)*h)//; 
  498.   rt z22l=(lft x22r+bowlstem.uc,(1-v_stress)*h);
  499.  
  500.   good_x_for(21r)(z22r,z24r,h_stress)f;good_x_for(21l)(z22l,z24l,(1-h_stress))g;
  501.   good_x_for(23r)(z22r,z24r,(1-h_stress))h;good_x_for(23l)(z22l,z24l,h_stress)i;
  502.  
  503.   p1=(leftserif(z14,z11,z13l,z11r,eps)..
  504.       arm.br(z8,z7r,z7l,.5as,.75tip_thickness,90-arm_angle)soft soften(z6,z4l)
  505.       arm.tr(z5r,z4l,z4r,.15as,.25tip_thickness,90) soften(z4r,z1)
  506.       arm.tr(z3,z2l,z2r,.4as,.75tip_thickness,90)soft...
  507.       leftserif(z11,z14,z12l,z14r,eps))--cycle;
  508.   p2 =z21r{left} o_t z22r{downward} o_t z23r{right} o_t z24r{upward} o_t 
  509.       z25r{upward} o_t cycle;
  510.   p2'=z21l{left} i_t z22l{downward} i_t z23l{right} i_t z24l{upward} i_t
  511.       z25l{upward} i_t cycle;
  512.  
  513.   showpoints(1,2,3,4,5,6,7,11,12,13,14,21,22,23,24,25);
  514. adjust(v_C*fitbasis.uc#+m_a*f_mfit#,v_F*fitbasis.uc#+m_a*f_mfit#); 
  515. show_character; endchar;
  516.  
  517. % Takes the O and E and overlaps them; thins right curve of the O;
  518. % shortens the serifs on the E
  519.  
  520.  
  521.  
  522.  
  523. iff OK "x":  "The uppercase O with slash"; 
  524.   beginchar(oct"037",O_w*width#+d_mono#,cap#,0);
  525.                              
  526.   if singlepitch:save circ; circ1=circ2=circ3=.75; fi 
  527.   top z1=(h_stress*w,h+ov_t.uc)//;                                   % circle 
  528.   lft z2=(0,(1-v_stress)*h)//;
  529.   bot z3=((1-h_stress)*w,-ov_b.uc)//;  
  530.   rt z4=(w,v_stress*h)//;      
  531.  
  532.   circular_shape(y1,y3,x2,x4,minor_curve.uc,bowlstem.uc);            % circle
  533.  
  534.   pickup  slashpen rotated angle((.95w,h)//-(.05w,0)//);             % slash
  535.   top rt z11=(.95w,1.1h)//;          
  536.   bot lft z12=(.05w,-.1h)//;  
  537.   draw z11--z12;
  538.  
  539.  showpoints(1,2,3,4,11,12);
  540. adjust(v_C*fitbasis.uc#+m_a*d_mfit#,v_C*fitbasis.uc#+m_a*d_mfit#); 
  541. show_character; endchar;
  542.  
  543. % This is just an uppercase "O" with a slash added
  544. % Only y1/y3 and x2/x4 values actually used; the points are put in for proofs
  545.  
  546.  
  547.  
  548. iff OK "x":  "Circumflex accent";   %******* 1 ACCENT WIDTH  x  2/3 ACCENT DEPTH
  549.   beginchar(oct"136",accent_w*width#+b_mono#,
  550.     accent_height#+xheight#+2/3accent_depth#,0); 
  551.  
  552.   save theta,adjustment;
  553.   bot lft z1=(0,h-max(1,2/3accent_depth))//;
  554.   top z2l=top z22=(.5w,h)//;  
  555.   rt z3=(w,y1)//;   
  556.   pos2(.6[accent_thin_end,accent_thick_end],-90);
  557.   pos22(min(apex.lc,.5stem.lc),0-apex_angle);
  558.   if y2=y1: x1:=x1+eps; fi      % keeps from division by 0 error on next line
  559.   if bold:theta1=theta3=180; adjustment=1/cosd (angle(z2-z1)+90); 
  560.     else:theta1=angle(z1-z2)+90;theta3=angle(z3-z2)+90; adjustment=1; fi
  561.   pos1(accent_thin_end*adjustment,theta1);
  562.   pos3(accent_thin_end*adjustment,theta3);
  563.   onaline(1,2)(23); onaline(1l,22l)(21);
  564.   onaline(2,3)(21); onaline(22r,3r)(23); 
  565.  
  566.   p1=if realsoft_accents: (z2r soften(z1r,z1l) z21{z21-z1l}...
  567.         z23{z3r-z23} soften(z3r,z3l) z2r)--cycle;
  568.        else: (z2r soften(z1r,z1l,z22l,z22r,z3r,z3l) z2r)--cycle; fi
  569.  
  570.   showpoints(1,2,3,21,22,23);
  571.  
  572. draw (0,xheight)--(w,xheight);
  573. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  574. show_character; endchar;
  575.  
  576. % Currently the angle of the accent is based on a varying "accent_depth"
  577. % The thetas are the angles at the ends, flattened for bold chars,
  578. % but theta could be an arbitrary value
  579.  
  580.  
  581.     
  582. iff OK "~":  "Tilde accent";   %******* 1 ACCENT WIDTH  x  .75  ACCENT DEPTH
  583.   beginchar(oct"176",accent_w*width#+b_mono#,
  584.     accent_height#+xheight#+.75accent_depth#,0); 
  585.  
  586.   save_pairs(end_dir);
  587.   top z2r=(.22w,h)//; 
  588.   bot z4l=(.78w,h-.75accent_depth)//;
  589.   multpos(2,4)(.75[accent_thin_end,accent_thick_end],90-oblique);  
  590.   pos3(.75[accent_thin_end,accent_thick_end],85-oblique);    
  591.      % controls mid-width if angle<>90
  592.   z3=.5[z2,z4]; 
  593.   lft z1r=(0,y4l)//;
  594.   rt z5l=(w,y2r)//;
  595.    end_dir1=if abs(y2r-y1r)>abs(x2r-x1r):upward else:(0,0) fi;
  596.    end_dir2=if abs(y5l-y4l)>abs(x5l-x4l):upward else:(0,0) fi;
  597.    ref1=z1r{end_dir1}...z2r{right};
  598.    ref2=z4l{right}...z5l{end_dir2};
  599.   pos1(accent_thin_end,(angle direction 0 of ref1)+90);
  600.   pos5(accent_thin_end,(angle direction 1 of ref2)+90);
  601.  
  602.   p1=(z2l{right}...z3l...z4l{right}...z5l{end_dir2}
  603.         if softpath:)softjoin(z5l--z5r)softjoin( else:-- fi z5r{-end_dir2}
  604.       ...z4r{left}...z3r...z2r{left}...z1r{-end_dir1}
  605.         if softpath:)softjoin(z1r--z1l)softjoin( else:-- fi z1l{end_dir1}
  606.       ...z2l{right})--cycle;
  607.  
  608.   showpoints(1,2,3,4,5);
  609.  
  610. draw (0,xheight)--(w,xheight);
  611. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  612. show_character; endchar;
  613.  
  614.  
  615. iff OK "x":  "Umlaut (German) or double dot accent"; 
  616.   beginchar(oct"177",accent_w*width#+b_mono#,
  617.     accent_height#+xheight#+2/3accent_depth#,0); 
  618.  
  619.   save_num(dot_size)=min(accent_dot_diameter,.5w-1);
  620.   lft z1=(0,h-.5dot_size)//;
  621.   rt z2=(w,h-.5dot_size)//;
  622.   p1=dot.l(z1,dot_size);
  623.   p2=dot.r(z2,dot_size);
  624.   showpoints(1,2);
  625.  
  626. draw (0,xheight)--(w,xheight);
  627. adjust(0+m_a*b_mfit#,0+m_a*b_mfit#); 
  628. show_character; endchar;
  629.  
  630. % no slant of shape with obliqueness
  631.  
  632.  
  633.